/*
 * Animation.h
 *
 *  Created on: 09-06-2013
 *      Author: Jarek
 */

#ifndef ANIMATION_H_
#define ANIMATION_H_

#include "GlobalData.h"
#include "EVector3.h"
#include "EQuaternion.h"

//assimp includes
#include "scene.h"

class Animation {
public:
	template<class KEY_TYPE>
	struct Key
	{
		float 		time;
		KEY_TYPE	key;

		Key() {}
		Key(float time, KEY_TYPE key) : time(time), key(key) {}
	};

	struct Keys
	{
		Key<Vector3<float> >*		translationKeys;
		Key<Quaternion<float> >*	rotationKeys;
		Key<Vector3<float> >*		scalingKeys;
		uint						translationKeysCount;
		uint						rotationKeysCount;
		uint						scalingKeysCount;

		Keys() : translationKeys(NULL), rotationKeys(NULL), scalingKeys(NULL), translationKeysCount(0), rotationKeysCount(0), scalingKeysCount(0) {}
	}keys;

	enum BEHAVIOUR
	{
		BEHAVIOUR_DEFAULT = 0,
		BEHAVIOUR_STATIC,
		BEHAVIOUR_REPEAT,


		BEHAVIOUR_MAX
	}prevState, postState;

	float startTime;
	float endTime;

public:
	Animation();
	virtual ~Animation();

	static BEHAVIOUR		mapAnimationState(aiAnimBehaviour behaviour);

	Vector3<float>			getTranslationData(float time);
	Quaternion<float>		getRotationData(float time);
	Vector3<float>			getScalingData(float time);
};

#endif /* ANIMATION_H_ */
